var should = require('should');
var harryHandler = require('../../../app/servers/pvp/handler/harryHandler');
var config = require('../../config');

suite('测试harryHandler', function () {
    suite('lucky', function () {
        test('抽取奖励', function (done) {
            var msg = {};
            var session = {};
            session.uid = config.role_id;

            var harry_Handler = new harryHandler();
            harry_Handler.lucky(msg, session, function (err, res) {
                done();
            });
        });

        test('抽取奖励', function (done) {
            var msg = {
                record_id: 1,
                position: 1
            };
            var session = {};
            session.uid = config.role_id;

            var harry_Handler = new harryHandler();
            harry_Handler.lucky(msg, session, function (err, res) {

                done();
            });
        });
    });

    suite('relucky', function () {
        test('重新抽奖', function (done) {
            var msg = {};
            var session = {};
            session.uid = config.role_id;

            var harry_Handler = new harryHandler();
            harry_Handler.relucky(msg, session, function (err, res) {
                done();
            });
        });

        test('重新抽奖', function (done) {
            var msg = {
                record_id: 1
            };
            var session = {};
            session.uid = config.role_id;

            var harry_Handler = new harryHandler();
            harry_Handler.relucky(msg, session, function (err, res) {
                res.code.should.equal(9006);
                done();
            });
        });
    });
});
